Quick Start
Installation
Install Docker
https://docs.docker.com/engine/install/
Show version
docker --version
Check image
docker images
第一次安裝 Docker 只會看到最上方 REPOSITORY TAG IMAGE ID CREATED SIZE 這排
Quick start
Download image
-
DockerHub
-
Search Python
Search 3.12-slim-bullseye
-
Download Docker image
docker pull python:3.12-slim-bullseye
-
查看 Docker image
docker images
A new python repository appears, and it has a tag 3.12-slim-bullseye
Manipulate container
-
Check running container
docker ps
Before starting the container, you will only see the row at the top showing CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-
Start a container
docker run -it -d --name docker-tutorial python:3.12-slim-bullseye /bin/bash
-
Check running container again
docker ps
-
Enter container
docker exec -it docker-tutorial /bin/bash
Cursor in terminal changed.